package com.raos.example.config;

import com.raos.example.service.Assistant;
import dev.langchain4j.model.chat.ChatLanguageModel;
import dev.langchain4j.service.AiServices;
import org.noear.solon.annotation.Bean;
import org.noear.solon.annotation.Configuration;
import org.noear.solon.annotation.Inject;

/**
 * AI配置类
 *
 * @author raos
 * @date 2025-04-04
 */
@Configuration
public class AIConfig {

    @Bean(name = "assistant")
    public Assistant init(@Inject(value = "qwenChatModel") ChatLanguageModel chatLanguageModel) {
        return AiServices.builder(Assistant.class)
                .chatLanguageModel(chatLanguageModel)
                .build();
    }

}
